﻿/* ==============================================================================
 * 功能描述：HUDItem  
 * 
 * 创 建 者：郑镇泉
 * 
 * 创建日期：2016/4/25 22:05:39
 * ==============================================================================*/
using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class HUDItem : MonoBehaviour
{
    /// <summary>
    /// 内容
    /// </summary>
    private Text contentText;

    /// <summary>
    /// 描边
    /// </summary>
    private Outline outline;

    /// <summary>
    /// 阴影
    /// </summary>
    private Shadow shadow;

    void Awake()
    {
        contentText = GetComponent<Text>();
        outline = GetComponent<Outline>();
        shadow = GetComponent<Shadow>();
    }

    /// <summary>
    /// 设置内容
    /// </summary>
    /// <param name="content"></param>
    public void SetContent(string content)
    {
        contentText.text = content;
    }

    /// <summary>
    /// 设置内容颜色
    /// </summary>
    /// <param name="color"></param>
    public void SetContentColor(Color color)
    {
        contentText.color = color;
    }

    /// <summary>
    /// 设置内容字体大小
    /// </summary>
    /// <param name="size"></param>
    public void SetFontSize(int size)
    {
        contentText.fontSize = size;
    }

    /// <summary>
    /// 设置描边颜色
    /// </summary>
    /// <param name="color"></param>
    public void SetOutlineColor(Color color)
    {
        outline.effectColor = color;
    }

    /// <summary>
    /// 设置阴影颜色
    /// </summary>
    /// <param name="color"></param>
    public void SetShadowColor(Color color)
    {
        shadow.effectColor = color;
    }

    /// <summary>
    /// 设置起始位置
    /// </summary>
    /// <param name="pos"></param>
    public void SetPosition(Vector3 pos)
    {
        transform.localPosition = pos;
    }
}